<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>extends</title>
</head>

<body>
    <script>
        class people {

            constructor(name, age) {
                this.age = age
                this.name = name
            }
            eay(){
                console.log('眼睛');
            }
            TVdrama(){
                console.log("仙剑奇侠传");
            }
        }
        class man extends people {
           constructor(name,age,xq,sg){
            super(name,age)
            this.xq=xq
            this.sg=sg
           }
        //    重写父类方法
           TVdrama(){
                console.log("琅琊榜");
            }
        }
        let hug=new man('胡歌',24,'演戏',188)
          console.log(hug);
          hug.eay()
        //   调用自身重写父类的方法了
          hug.TVdrama();//
    </script>
</body>

</html>